import G2 from '@antv/g2';
var sliceNumber = 0.01;
// 自定义 other 的图形，增加两条线
G2.Shape.registerShape('interval', 'sliceShape', {
  draw: function draw (cfg, container) {
    var points = cfg.points;
    var path = [];
    path.push(['M', points[0].x, points[0].y]);
    path.push(['L', points[1].x, points[1].y - sliceNumber]);
    path.push(['L', points[2].x, points[2].y - sliceNumber]);
    path.push(['L', points[3].x, points[3].y]);
    path.push('Z');
    path = this.parsePath(path);
    return container.addShape('path', {
      attrs: {
        fill: cfg.color,
        path: path
      }
    });
  }
});
G2.Shape.registerShape('interval', 'flowerShape', {
  draw: function draw (cfg, container) {
    var points = cfg.points;
    var origin = cfg.origin._origin;
    var percent = origin.value / cfg.style.flowerShape.max;
    var xWidth = points[2].x - points[1].x;
    var width = xWidth * percent;
    var path = [];
    path.push(['M', points[0].x, points[0].y]);
    path.push(['L', points[1].x, points[1].y]);
    path.push(['L', points[0].x + width, points[2].y]);
    path.push(['L', points[0].x + width, points[3].y]);
    path.push('Z');
    path = this.parsePath(path);
    return container.addShape('path', {
      attrs: {
        fill: cfg.color,
        path: path
      }
    });
  }
});
G2.LW_CONSTANCE = {
  COLOR_PIE: ["#1890FF", "#13C2C2", '#207837', "#2FC25B", "#FACC14", "#F04864", '#ff18fa', "#8543E0", "#3436C7", "#223273"]
};
export default G2;
